home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / rclesrc.10 / ircle sources / IRCGlobals.p < prev    next >
Encoding:
Text File  |  1992-09-06  |  4.3 KB  |  155 lines

  1. {    ircle - Internet Relay Chat client    }
  2. {    File: IRCGlobals    }
  3. {    Copyright ⌐ 1992 Olaf Titz (s_titz@iravcl.ira.uka.de)    }
  4.  
  5. {    This program is free software; you can redistribute it and/or modify    }
  6. {    it under the terms of the GNU General Public License as published by    }
  7. {    the Free Software Foundation; either version 2 of the License, or    }
  8. {    (at your option) any later version.    }
  9.  
  10. {    This program is distributed in the hope that it will be useful,    }
  11. {    but WITHOUT ANY WARRANTY; without even the implied warranty of    }
  12. {    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    }
  13. {    GNU General Public License for more details.    }
  14.  
  15. {    You should have received a copy of the GNU General Public License    }
  16. {    along with this program; if not, write to the Free Software    }
  17. {    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.    }
  18.  
  19. unit IRCGlobals;
  20. { Contains global constants and variables }
  21.  
  22. interface
  23. uses
  24.     TCPTypes, TCPStuff, TCPConnections, MsgWindows;
  25.  
  26. type
  27.     defaultType = record
  28.             Port: integer;
  29.             Server, Nick, username, userLoginName, autoExec: str255;
  30.             notify: array[1..4] of boolean;
  31.         end;
  32.     defaultPtr = ^defaultType;
  33.     defaultHndl = ^defaultPtr;        { Preferences }
  34.  
  35.     shortcutsType = array[1..10] of str255;
  36.     shortcutsPtr = ^shortcutsType;
  37.     shortcutsHndl = ^shortcutsPtr;    { Shortcuts }
  38.  
  39.     FSType = record
  40.             fnt, siz: integer
  41.         end;
  42.     FSPtr = ^FSType;
  43.     FSHndl = ^FSPtr;                { default font/size }
  44.  
  45.     Table = packed array[char] of char;
  46.     TablePtr = ^Table;
  47.     TableHndl = ^TablePtr;        { charset translation table }
  48.  
  49. const
  50.     COSPACE = 10000;        { Workspace to allocate for Coroutines }
  51.     LOFREEMEM = 20000;        { Memory checking lower (critical) bound }
  52.     HIFREEMEM = 30000;        { Memory checking higher (uncritical) bound }
  53.     MEMTIME = 30;            { Memory checking timeout (seconds) }
  54.  
  55.     DCC_CHAT_PREFIX = '=';
  56.  
  57. { Error messages (STR#256 indexes) }
  58.     E_NOSERVER = 1;        { Not connected }
  59.     E_NOTARGET = 2;        { Not talking to a target }
  60.     E_SFAILED = 3;            { Corresponding with ConnectionEvents }
  61.     E_NSFAILED = 4;
  62.     E_OFAILED = 5;
  63.     E_CLOSING = 6;
  64.     E_CLOSED = 7;
  65.  
  66. { Connection status }
  67.     S_CONN = 0;            { connected }
  68.     S_OFFLINE = -1;            { offline }
  69.     S_LOOKUP = -2;            { DNS lookup }
  70.     S_OPENING = -3;            { connecting }
  71.  
  72. { Alerts }
  73.     A_INFO = 128;            { About box }
  74.     A_TCPERR = 129;        { Cannot open TCP driver }
  75.     A_QUIT = 131;            { Ask whether to quit }
  76.     A_LOWMEM = 259;        { Memory shortage }
  77.     A_OPKILL = 260;        { Operator kill }
  78.     A_SSTAT = 261;        { Server connection status }
  79.  
  80. { Dialogs }
  81.     D_INFOPOP = 130;        { Popup status window }
  82.     D_PREFS = 256;            { Preferences }
  83.     D_SHCUTS = 257;        { Shortcuts }
  84.  
  85. { Menus }
  86.     M_F_OPEN = 1;
  87.     M_F_CLOSE = 2;
  88.     M_F_LOG = 4;
  89.     M_F_FLUSH = 5;
  90.     M_F_PREFS = 7;
  91.     M_F_QUIT = 9;
  92.     M_COMMANDS = 259;        { Commands menu }
  93.     M_CO_JOIN = 1;
  94.     M_CO_PART = 2;
  95.     M_CO_LIST = 4;
  96.     M_CO_WHO = 5;
  97.     M_CO_QUERY = 7;
  98.     M_CO_WHOIS = 8;
  99.     M_CO_INVITE = 9;
  100.     M_CO_KICK = 10;
  101.     M_CO_AWAY = 12;
  102.     M_CO_MSG = 13;
  103.     M_SHCUTS = 261;        { Shortcuts menu }
  104.     M_SH_DEFINE = 1;
  105.     M_SH_FIRST = 2;
  106.     M_FONT = 262;            { Fonts menu }
  107.     M_FO_9 = 1;
  108.     M_FO_10 = 2;
  109.     M_FO_12 = 3;
  110.     M_FO_14 = 4;
  111.     M_FO_FIRST = 5;
  112.     M_WINDOWS = 263;        { Windows menu }
  113.     M_WI_CYCLE = 1;
  114.     M_WI_MAIN = 2;
  115.     M_WI_FIRST = 3;
  116.  
  117.  
  118. var
  119. { general status vars }
  120.     CL_VERSION: string;        { Version of this program }
  121.     serverStatus: integer;    { Connection status: 0=ok, -1=not connected, or TCP error codes }
  122.     validPrefs,                { Indicates whether preferences are set proper }
  123.     QuitRequest,            { Will quit }
  124.     flushing,                 { Ignore server output up to end of list }
  125.     logging,                { Logging to file }
  126.     inBackground,            { Running in background }
  127.     notified                { User has got notfication from background }
  128.     : boolean;
  129.     sSocket: connectionIndex;    { Server connection }
  130.     lastWindow: MWHndl;        { window las notice went in }
  131.     readTimeout,            { timeout for TCP reading }
  132.     idleTime: longint;        { time when last command sent }
  133.     NFT: integer;            { number of DCC filetransfers in progress }
  134.  
  135. { user vars }
  136.     CmdChar: char;            { Command prefix }
  137.     CurrentServer,             { server currently connected to }
  138.     CurrentTarget,            { current target to talk to (corresponds to active window) }
  139.     CurrentNick,             { Nickname }
  140.     lastInvite,                { Channel to which got last invited }
  141.     lastMsg                { Nick who sent last MSG }
  142.     : str255;
  143.     logfile: text;            { File to log to }
  144.  
  145. { user preferences }
  146.     default: defaultHndl;
  147.     Shortcuts: shortcutsHndl;
  148.     defFont: FSHndl;
  149.  
  150.     ISOEncode, ISODecode: TableHndl;
  151.  
  152.  
  153. implementation
  154. { Global variables get initialized in IRCInit }
  155. end.